<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
if(!function_exists('facebook_like')){

 function facebook_like($url,$option){
   //checking layout
          //standard layout with profile photos have height : 80px;
          //standard layout without profile photos have height : 35px;
   if($option['layout']=='standard'){
     if($option['show_faces']=='true'){
       $height='80';
     }else{
       $height='35';
     }
   }else if($option['layout']=='box_count'){
          //box_count layout have height : 65px;
     $height='65';
   }else if($option['layout']=='button_count'){
          //button_count layout have height : 21px;
     $height='21';
   }else{
     $option['layout']='standard';
     $height='35';
   }
          //build the button
   $formlink='<iframe src="http://www.facebook.com/plugins/like.php?href=';
   $formlink .= urlencode($url);
   $formlink .= '&amp;layout='.$option['layout'].'&amp;show_faces='
       .$option['show_faces'].'&amp;width='.$option['width'].'&amp;action='
       .$option['action'].'&amp;colorscheme='.$option['colorscheme'].'&amp;
       height='.$height.'" scrolling="no" frameborder="0" style="border:none;
       overflow:hidden; width:'.$option['width'].'px; height:'.$height.'px;"
       allowTransparency="true"></iframe>';

   return $formlink;

  }
}